const express = require('express');
var orderController = require('../controller/order.controller');

module.exports = (app)=>{
    var router = express.Router();


    router.route('/')
        .post(orderController.addOrder);

    router.route('/:orderId')
        .get(orderController.findByOrderId);

    router.route('/findByCustomerId/:customerId')
        .get(orderController.findOrders);

    router.route('/confirmOrder/:orderId')
        .put(orderController.confirmOrder);

    app.use('/orders',router);

    return router;
}
